<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			// 正则表达:[a-z]+://[a-z.]+:[0-9]+((/[a-z]+)+)\?([a-z]+=[a-z]+)-[a-z]+
			var URL = 'https://www.zhipin.com:5050/web/geek/chat?ka=header-message'
			var arr = URL.split('://')
			var protocol = arr[0]
				arr = arr[1].split('-')
			var hash = arr[1]
				arr = arr[0].split('?')
			var search = arr[1]
			    arr = arr[0].split('/')
			var host = arr.shift()
			var pathName = arr.join('/')
			var hostName = host.split(':')[0]
			var port = host.split(':')[1]
			console.log(hostName , protocol, port ,hash,search,host,pathName)
		</script>
	</body>
</html>
